<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>

  <style>
    * {
      margin: 0;
      padding: 0;
    }

    ul,
    li {
      list-style: none;
      /* 去除默认圆点 */
    }

    a {
      text-decoration: none;
      color: #000;
    }

    ul.box>li.user {
      width: 100px;
      height: 40px;
    }

    ul.box>li.user>a {
      width: 100%;
      height: 100%;
      display: block;
      background: #ccc;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    ul.box>li.user:hover .down-menu {
      display: block;
    }

    ul.box>li>.down-menu {
      background: #fb3;
      width: 100px;
      display: none;
    }

    ul.box>li>.down-menu>li {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 30px;
      border-bottom: 1px solid #fff;
      cursor: pointer;
    }
  </style>
</head>

<body>
  <ul class="box">
    <li class="user">
      <a href="###">
        <span>admin</span>
      </a>
      <ul class="down-menu">
        <li>个人中心</li>
        <li>修改密码</li>
        <li>退出</li>
      </ul>
    </li>
  </ul>
</body>

</html>